package com.wx.date_;

import java.text.SimpleDateFormat;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/7/25 - 11:08
 */
public class Instant_ {
    public static void main(String[] args) {
        Instant now = Instant.now();
        DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        Date date = Date.from(now);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(now);
        System.out.println(date);
        System.out.println(sdf.format(date));
    }
}
